package org.weineng.login.service.impl;
import org.weineng.login.dao.IUserDAO;
import org.weineng.login.service.IUserService;
import org.weineng.login.vo.User;
public class UserService implements IUserService{
	private IUserDAO userDAO;
	public User validateUser(String username,String password){
		return userDAO.validateUser(username, password);
	}
	public User registerUser(User user){
		userDAO.saveUser(user);			
		return userDAO.validateUser(user.getUsername(), user.getPassword());
	}
	public IUserDAO getUserDAO(){
		return userDAO;
	}
	public void setUserDAO(IUserDAO userDAO){
		this.userDAO=userDAO;
	}
	public boolean exitUser(String username){
		return userDAO.exitUser(username);
	}
}
